<extend file='resource/admin/wechat'/>
<block name="content">
    <!-- TAB NAVIGATION -->
    <ul class="nav nav-tabs" role="tablist">
        <li class="active"><a href="{{url('wx.index')}}">微信基本消息管理</a></li>
        <li><a href="{{url('wx.post')}}" >添加基本回复</a></li>
    </ul>
    <table class="table table-hover">
        <thead>
        <tr>
            <th width="8%">编号</th>
            <th width="">关键字</th>
            <th width="">回复内容</th>
            <th width="">上传时间</th>


        </tr>
        </thead>
        <tbody>
        <foreach from="$res" value="$d">
            <tr>
                <td>{{$d['id']}}</td>
                <td>{{$d['keywords']}}</td>
                <td>{{$d['content']}}</td>
                <td>{{$d['created_at']}}</td>
                <td>
                    <div class="btn-group btn-group-sm">
<!--                          这边url是自己写的如果 不能接收到第三个参数的话  就去system helper 中增加一段http_build_query（）！-->
                        <a href="{{url('wx.post','',['id'=>$d['id']])}}"class="btn btn-success">编辑</a>
                        <a href="javascript:" onclick="del({{$d['id']}})" class="btn btn-danger">删除</a>

                    </div>
                </td>
            </tr>
        </foreach>
        </tbody>
    </table>

    <script>
        function del(id){
         util.confirm('删除确认！',function (res) {

             location.href = "{{url('wx.del')}}&id="+id;

         })
        }
    </script>
</block>
